﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Xceed.Wpf.Toolkit;
using System.Collections.ObjectModel;

namespace Jiuyong
{
	/// <summary>
	/// InputStringWindow.xaml 的交互逻辑
	/// </summary>
	public partial class InputStringWindow : ChildWindow
	{
		public InputStringWindow()
		{
			InitializeComponent();
			OKButton.Click += OKButton_Click;
			CancelButton.Click += CancelButton_Click;
		}

		void CancelButton_Click(object sender, RoutedEventArgs e)
		{
			DialogResult = false;
		}

		void OKButton_Click(object sender, RoutedEventArgs e)
		{
			DialogResult = true;
		}

		public ViewModels.InputStringViewModel ViewModel
		{
			get
			{
				return DataContext as ViewModels.InputStringViewModel;
			}
		}
	}

	namespace ViewModels
	{
		public class InputStringViewModel:ViewModelBase
		{
			private string _inputString;
			public string InputString
			{
				get
				{
					return _inputString;
				}

				set
				{
					_inputString = value;
					OnPropertyChanged("InputString");
				}
			}

			private ObservableCollection<string> _otherStrings = new ObservableCollection<string>();
			public ObservableCollection<string> OtherStrings
			{
				get
				{
					return _otherStrings;
				}

				set
				{
					_otherStrings = value;
					OnPropertyChanged("OtherStrings");
				}
			}

			private string _messageText = "输入字符串(_I)：";
			public string MessageText
			{
				get
				{
					return _messageText;
				}

				set
				{
					_messageText = value;
					OnPropertyChanged("MessageText");
				}
			}

		}
	}
}
